<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/11/29 0029
  Time: 下午 5:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>个人基本信息</title>
    <link rel="stylesheet" href="/static/plugins/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/common.css">
</head>
<body>
<div>
    <div class="box-padding-15">
<span class="layui-breadcrumb">
          <a href="#">首页</a>
          <a href="javascript:;">用户管理</a>
          <a><cite>基本信息</cite></a>
        </span>
    <hr>
            <div class="box-form">
              <form class="layui-form" method="post">
                  <div class="layui-form-item">
                      <label class="layui-form-label">账户</label>
                      <div class="layui-input-block">
                          <input type="text" name="userName" value="${account.userName}"  lay-verify="required" autocomplete="off" class="layui-input">
                          <input type="hidden" name ="uId" value="${account.uId}">
                      </div>
                  </div>
                  <div class="layui-form-item">
                      <label class="layui-form-label">工号</label>
                      <div class="layui-input-block">
                          <input type="text" name="personId" value="${account.personId}" lay-verify="required"  autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  <div class="layui-form-item">
                      <label class="layui-form-label">姓名</label>
                      <div class="layui-input-block">
                          <input type="text" name="realName" value="${account.realName}"  lay-verify="required" autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  <div class="layui-form-item" >
                      <div class="layui-input-block">
                          <a href="/" target="_top"><button type="button" class="layui-btn layui-btn-primary">返回</button></a>
                      </div>
                  </div>
            </form>
            </div>
            </div>
</div>

<script src="/static/plugins/jquery.js"></script>
<script src="/static/plugins/layui/layui.js"></script>
<script>
    layui.use(['form','element'], function(){
        var form=layui.form;
        var element=layui.element;
        form.on('submit(formDemo)', function(data){
            debugger
            //进行异步修改
            $.ajax({
                url: "/login/message",
                type:"post",
                data:data.field,
                dataType: 'json',
                success:function(rs){
                    debugger
                    layer.msg(rs.message,{time:1000},function () {
                        if(rs.code == 1) {
                            parent.layui.layer.msg("修改成功，请重新登陆", {time: 2000}, function () {
                                parent.location.href = "/login";
                            })
                        }else{
                            layer.msg(msg.message,{icon:2,time:1500})
                        }
                    });
                },
                error:function(){
                    layer.msg("服务器忙，请稍后再试！");
                }
            });
            return false;
        });
    });
</script>
</body>
</html>
